cmake_minimum_required(VERSION 3.20)

project(test)
# 缓存项
set(IS_START ON CACHE BOOL "BOOL变量" FORCE)
set(FILE_PATH "D:/temp" CACHE FILEPATH "文件路径" FORCE)
set(DIR_PATH "D:/temp/build" CACHE PATH "目录路径" FORCE)
set(SINGLE_LINE "Hello CMake" CACHE STRING "单行文本" FORCE)

# 设置多行文本(CMake-GUI 下拉框)
set(MULTI_LINE "" CACHE STRING "多行文本" FORCE)
set_property(CACHE MULTI_LINE PROPERTY STRINGS "" "Hello" "CMake" "Arhc Linux")

# CMake_GUI 不可见
set(INTERNAL_VAR "internal value" CACHE INTERNAL "常量" FORCE)

# 取消设置变量
# unset(SINGLE_LINE CACHE)

add_executable(test main.cpp) 